<template>
  <div class="list">
    <div class="title">
      <span>{{name}}</span>
    </div>
    <el-input placeholder="输入纪念馆名称"></el-input>
    <van-button round type="danger">搜索</van-button>
    <ul class="roomlist" v-for="(item,index) in data" :key="index">
      <van-swipe-cell :right-width="45" >
        <li @click="detailPage(item)" >
          <img :src="item.picurlofdeath">
          <van-cell-group>
            <van-cell :title="item.username" is-link :label="item.deathdate" />
          </van-cell-group>
        </li>
        <!-- <span slot="right" @click="deleteC(item.id)">删除</span> -->
      </van-swipe-cell>
    </ul>
    <!-- <span class="value" @click="message">久久怀念网使用协议</span> -->
  </div>
</template>

<script>
export default {
  data () {
    return {
      ms: true,
      data: [
        {
            username: 'zhansa ',
            deathdate: '100-10-10'
        },
        {
            username: 'asda ',
            deathdate: '890-10-10'
        }
      ],
      name: ''
    }
  },
  created () {
    let type = this.$route.query.type
    console.log(typeof type)
    switch (type) {
        case '0': 
            this.name = '吊唁馆列表'
            break;
        case '1': 
            this.name = '纪念堂列表'
            break;
        case '2': 
            this.name = '陵园列表'
            break;
        case '3': 
            this.name = '高档墓园列表'
            break;
        case '4': 
            this.name = '综合列表'
            break;
        default: 
            break;
    }
    console.log(this.name)
    // // this.getData()
    // this.$store.commit('USER_ID', this.userid)
  },
  methods: {
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.roomlist{
  li {
    display: flex;
    padding: 10px;
    img {
      height: 74px;
      width: 74px;
    }
  }
}
.title{
  width: 100%;
  height: 40px;
  text-align: center;
  line-height: 40px;
  background: #31a2c8;
  color: #fff;
}
.value{
  color: #31a2c8;
  font-size: 13px;
  text-align: center;
  width: 100%;
  position: fixed;
  bottom: 0;
  display: block;
  height: 40px;
  line-height: 40px;
  text-decoration: underline;
}
.add {
    width: 90%;
    margin: 10px auto;
    height: 80px;
    line-height: 80px;
    /* padding: 10px 0; */
    border: 1px dotted #ccc;
    text-align:center;
    color: #31a2c8;
  }
</style>
<style>
.van-nav-bar .van-icon{
    color: #fff !important;
  }
.list .van-cell-group{
    width: 100%;
  }
.list .van-cell__label{
    line-height: 30px;
  }
  .list .van-icon {
    position: absolute;
    right: 15px;
    top: 12px;
  }
  .list .el-input {
      width: 180px;
      margin-left: 20px;
      margin-top: 10px;
  }
  .list .van-button--danger{
      height: 35px;
      line-height: 35px;
      background: #31a2c8 !important;
      border-color: #31a2c8 !important;
  }
</style>
